package com.cc2019.buke.home.activity;

import android.os.Bundle;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.cc2019.buke.R;
import com.cc2019.buke.home.adapter.ProChannelAdapter;
import com.cc2019.buke.home.entry.Channel;

import java.util.ArrayList;
import java.util.List;


public class ProChannelActivity extends AppCompatActivity {
    private RecyclerView recyclerView;
    public static final int LOAD = 0;
    public static final int FRESH = 1;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_pro_channel);
        recyclerView = findViewById(R.id.my_recycleView2);
        List<Channel> pro_list = init();
        ProChannelAdapter proChannelAdapter = new ProChannelAdapter(pro_list, this);
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
        recyclerView.setLayoutManager(linearLayoutManager);
        recyclerView.setAdapter(proChannelAdapter);
    }

    public List<Channel> init() {
        ArrayList<Channel> pros = new ArrayList<>();
        Channel channel = new Channel();
        Channel pro1 = new Channel("言情", 22,R.drawable.prochan1);
        Channel pro2 = new Channel("小说", 222,R.drawable.prochan2);
        Channel pro3 = new Channel("文学", 222,R.drawable.prochan3);
        Channel pro4 = new Channel("艺术",  222,R.drawable.prochan4);
        Channel pro5 = new Channel("古诗词",  222,R.drawable.prochan5);
        Channel pro6 = new Channel("青春文学",  222,R.drawable.prochan6);
        Channel pro7 = new Channel("连环画", 222,R.drawable.prochan7);
        Channel pro8 = new Channel("动漫",  222,R.drawable.prochan8);
        Channel pro9 = new Channel("摄影", 222,R.drawable.prochan9);
        Channel pro10 = new Channel("传记",  222,R.drawable.prochan10);
        Channel pro11 = new Channel("考试",  222,R.drawable.prochan11);
        Channel pro12 = new Channel("教材",  222,R.drawable.prochan12);
        Channel pro13 = new Channel("历史",  222,R.drawable.prochan12);
        pros.add(pro1);pros.add(pro4);pros.add(pro7);pros.add(pro10);pros.add(pro12);
        pros.add(pro2);pros.add(pro5);pros.add(pro8);
        pros.add(pro3);pros.add(pro6);pros.add(pro9);pros.add(pro11);pros.add(pro13);
        return pros;
    }
}